﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QLNS.Models
{
    public class CommonModels
    {
        public static string XuLyDuongDanHinhAnh(String path)
        {
            string physicalPath = HttpContext.Current.Request.PhysicalApplicationPath;
            path = path.Replace(physicalPath, "");
            path = path.Replace("\\", "/");
            return path;
        }
        private static readonly string[] VietNamChar = new string[] 
        { 
            "aAeEoOuUiIdDyY", 
            "áàạảãâấầậẩẫăắằặẳẵ", 
            "ÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴ", 
            "éèẹẻẽêếềệểễ", 
            "ÉÈẸẺẼÊẾỀỆỂỄ", 
            "óòọỏõôốồộổỗơớờợởỡ", 
            "ÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠ", 
            "úùụủũưứừựửữ", 
            "ÚÙỤỦŨƯỨỪỰỬỮ", 
            "íìịỉĩ", 
            "ÍÌỊỈĨ", 
            "đ", 
            "Đ", 
            "ýỳỵỷỹ", 
            "ÝỲỴỶỸ" 
        };
        public static string LocDau(string str)
        {
            //Thay thế và lọc dấu từng char      
            for (int i = 1; i < VietNamChar.Length; i++)
            {
                for (int j = 0; j < VietNamChar.Length; j++)
                    str = str.Replace(VietNamChar[j], VietNamChar[0]);
            }
            return str;
        }
    }
    public class MyModels
    {
        public QHGD qhgd { get; set; }
        public CanBo cb { get; set; }

        public bool ischeck { set; get; }
    }
}